﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Unidad.aspx.cs" Inherits="Manto_Unidad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <h1>
        Unidades
    </h1>
    <h2>
        Criterios de Búsqueda
    </h2>
    <table style="table-layout:fixed;width:100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td width="140px"></td>
            <td width="80px"></td>
            <td width="80px"></td>
            <td width="80px"></td>
            <td></td>
        </tr>
        <tr>
            <td class="td_campoFiltro">
                <asp:Label ID="lblDescripcion" runat="server" Text="Descripción"></asp:Label>
            </td>
            <td colspan="3">
                <asp:TextBox ID="txtDescripcion" runat="server" CssClass="txtFiltro" Width="100%"></asp:TextBox>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td colspan="5">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="5" align="right"  class="BarraBotones">
                <asp:Button ID="btnBuscar" runat="server" Text="Buscar" CssClass="boton" 
                    onclick="btnBuscar_Click" />
                &nbsp;
                <asp:Button ID="btnLimpiar" runat="server" Text="Limpiar" CssClass="boton" 
                    onclick="btnLimpiar_Click" />
                &nbsp;
                <asp:Button ID="btnAgregar" runat="server" Text="Agregar" CssClass="boton" 
                    onclick="btnAgregar_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="5">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="5">
                <asp:UpdatePanel ID="upUnidades" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>

                        <asp:GridView   ID="gvUnidades" 
                                        Width="100%" 
                                        runat="server" 

                                        CssClass="mGrid" 
                                        GridLines="None"
                                        PagerStyle-CssClass="pgr"
                                        AlternatingRowStyle-CssClass="alt"

                                        AutoGenerateColumns="False" 
                                        AllowPaging="True" 
                                        PageSize="10"
                                        CellPadding="0" 
                            onpageindexchanging="gvUnidades_PageIndexChanging" 
                            onrowcommand="gvUnidades_RowCommand" onrowdatabound="gvUnidades_RowDataBound">
                            <Columns>
                                <asp:TemplateField HeaderText="Código">
                                    <ItemTemplate>
                                        <asp:Label ID="lblCodigo" runat="server" Text='<%# Bind("id_unidad") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center"/>
                                    <ItemStyle Width="10%" HorizontalAlign="Left"/>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Descripción">
                                    <ItemTemplate>
                                        <asp:Label ID="lblDescripcion" runat="server" Text='<%# Bind("descripcion") %>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center"/>
                                    <ItemStyle Width="75%" HorizontalAlign="Left"/>
                                </asp:TemplateField>
               
                                    
                                <asp:TemplateField HeaderText="Opciones" ShowHeader="False">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="btnVerDetalle" runat="server" CausesValidation="False" CommandName="VER" Height="24px"  Text="Ver Detalle" Width="24px" ImageUrl="~/Img/imgVerDetalle.png" ToolTip="Ver Detalle" Visible="true"/>
                                        <asp:ImageButton ID="btnModificar" runat="server" CausesValidation="False" CommandName="MODIFICAR" Height="24px"  Text="Ver Detalle" Width="24px" ImageUrl="~/Img/imgEditar.png" ToolTip="Editar" Visible="true"/>
                                        <asp:ImageButton ID="btnEliminar" runat="server" CausesValidation="False" CommandName="ELIMINAR" Height="24px"  Text="Ver Detalle" Width="24px" ImageUrl="~/Img/imgEliminar.png" ToolTip="Eliminar" Visible="true"/>
                                
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Center"/>
                                    <ItemStyle HorizontalAlign="Center" Width="15%" />
                                </asp:TemplateField>
                            </Columns>
                            <EmptyDataTemplate>
                                <asp:Label ID="LblVacio" runat="server" Text="No se encontraron datos"></asp:Label>
                            </EmptyDataTemplate>
                            <PagerStyle HorizontalAlign="Center"/>
                        </asp:GridView>

                    </ContentTemplate>  
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnBuscar" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="gvUnidades" EventName="PageIndexChanging" />
                        <asp:AsyncPostBackTrigger ControlID="gvUnidades" EventName="RowCommand" />
                    </Triggers>
                </asp:UpdatePanel>

                
            </td>
        </tr>
    </table>
</asp:Content>

